﻿/*------------------------------------------------
// File Description: BadReason DataBase Entity
// Author:			 Crane
// Create Time:		 2020-10-25 15:40:17
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 
    /// </summary>
    [Table(nameof(BadReason))]
    public class BadReason : BaseEntity
    {
        private string _badTypeCode = string.Empty;
        private string _reasonCode = string.Empty;
        private string _reasonVN = string.Empty;
        private string _reasonEN = string.Empty;
        private string _reasonCN = string.Empty;

        #region Public Property

        ///<Summary>
        /// 异常站点
        ///</Summary>
        public Enum.JudgeType? ReasonType { get; set; }

        ///<Summary>
        /// 类型代码
        ///</Summary>
        public string BadTypeCode
        {
            get { return string.IsNullOrWhiteSpace(_badTypeCode) ? string.Empty : _badTypeCode; }
            set { _badTypeCode = value; }
        }

        /// <summary>
        /// 终检按钮序号
        /// </summary>
        public int? KeyIndex { get; set; }

        ///<Summary>
        /// 原因代码
        ///</Summary>
        public string ReasonCode
        {
            get { return string.IsNullOrWhiteSpace(_reasonCode) ? string.Empty : _reasonCode; }
            set { _reasonCode = value; }
        }

        ///<Summary>
        /// 原因（越文）
        ///</Summary>
        public string ReasonVN
        {
            get { return string.IsNullOrWhiteSpace(_reasonVN) ? string.Empty : _reasonVN; }
            set { _reasonVN = value; }
        }

        ///<Summary>
        /// 原因（英文）
        ///</Summary>
        public string ReasonEN
        {
            get { return string.IsNullOrWhiteSpace(_reasonEN) ? string.Empty : _reasonEN; }
            set { _reasonEN = value; }
        }

        ///<Summary>
        /// 原因（中文）
        ///</Summary>
        public string ReasonCN
        {
            get { return string.IsNullOrWhiteSpace(_reasonCN) ? string.Empty : _reasonCN; }
            set { _reasonCN = value; }
        }

        /// <summary>
        /// 是否来料不良
        /// </summary>
        public bool IsMaterielBad { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 
        /// </summary>
        public virtual DbSet<BadReason> BadReasons { get; set; }
    }
}